from numpy import square
from manimlib import *
#75cfb8
#bbdfc8
#f0e5d8
#ffc478
class p1(Scene):
    def construct(self):
        # self.add(NumberPlane())
        arc=Arc(0,PI,radius=6).shift(DOWN*3)
        li4=[]
        for i in range(4):
            li4.append(arc.point_from_proportion(0.8-i*0.2))
        a,b=[-6,-3,0],[6,-3,0]
        ab=Line(a,b)
        self.add(arc,ab)
        li5=[a,[-np.cos(72*np.pi/180)*12,-3,0],[0,-3,0],[np.cos(72*np.pi/180)*12,-3,0],b]
        print(arc.point_from_proportion(0.8))
        for i in range(4):
            self.add(Line(li4[i],li5[i]),Line(li4[i],li5[i+1]))
            a=Arc(252*DEGREES,36*DEGREES,arc_center=li4[i],stroke_color='#75cfb8')
            self.add(Tex(r'\alpha',color='#75cfb8').next_to(a,DOWN),a)
        self.add(Tex(r'\alpha=?',color='#75cfb8'))
        self.wait()
class p2(Scene):
    def construct(self):
        # self.add(NumberPlane())
        c=Circle(radius=3)
        li_c=[]
        for i in range(10):
            li_c.append(c.point_from_proportion(1-i*0.1))
        li_c.append(li_c[0])
        a,b=[-3,0,0],[3,0,0]
        ab=Line(a,b)
        for i in range(5):
            self.add(Line(li_c[i],li_c[9-i]))
        for i in range(1,6):
            self.add(Line(li_c[i],li_c[11-i]))
        self.add(c,ab)
        self.wait()
class p3(Scene):
    def construct(self):
        # self.add(NumberPlane())
        circle=Circle(radius=3)
        li_c=[]
        for i in range(10):
            li_c.append(circle.point_from_proportion(i*0.1))
        a,b=[-3,0,0],[3,0,0]
        c,d,e,f=li_c[4],li_c[7],li_c[2],li_c[9]
        ab,cd,de,ef,bf,ac=Line(a,b),Line(c,d),Line(d,e),Line(e,f),Line(b,f),Line(a,c)
        self.add(circle,ab,cd,de,ef,bf,ac)
        ta=Tex('A').next_to(a,LEFT)
        tb=Tex('B').next_to(b,RIGHT)
        tc=Tex('C').next_to(c,UL)
        td=Tex('D').next_to(d,DOWN)
        te=Tex('E').next_to(e,UP)
        tf=Tex('F').next_to(f,DOWN)
        arc_d=Arc(72*DEGREES,36*DEGREES,arc_center=d)
        arc_f=Arc(72*DEGREES,36*DEGREES,arc_center=f)
        arc_a=Arc(0,72*DEGREES,arc_center=a)
        bd=Tex(r'\alpha').next_to(arc_d,UP)
        bf=Tex(r'\alpha').next_to(arc_f,UP)
        self.add(ta,tb,tc,arc_a,arc_d,arc_f,bd,bf,td,te,tf)
        self.wait()
class p4(Scene):
    def construct(self):
        # self.add(NumberPlane())
        circle=Circle(radius=3)
        o=circle.point_from_proportion(0.7)
        a=circle.point_from_proportion(0.1)
        b=circle.point_from_proportion(0.5)
        arc=ArcBetweenPoints(a,b,36*4*DEGREES,stroke_color='#75cfb8',stroke_width=6)
        self.add(Line(o,a),Line(o,b),circle,arc)
        t1=Tex(r'\theta').next_to(o,UP)
        t2=Tex(r'2\theta',color='#75cfb8').next_to(arc,UP)
        self.add(t1,t2)
        self.wait()